import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import GoodsList from '../views/GoodsList.vue'
import GoodsDetail from '../views/GoodsDetail.vue'
import Search from '../views/Search.vue'
import NewsList from '../views/NewsList.vue'
import NewsDetail from '../views/NewsDetail.vue'
import Business from '../views/newList/Business.vue'
import Bloc from '../views/newList/Bloc.vue'
import Poly from '../views/newList/Poly.vue'
import SA from '../views/newList/SA.vue'

Vue.use(VueRouter)

const routes = [{
        path: '/',
        name: 'Home',
        component: Home
    }, {
        path: '/search',
        name: 'Search',
        component: Search
    },
    {
        path: '/newsList',
        name: 'NewsList',
        component: NewsList,
        children: [{
            path: '/business',
            name: 'Business',
            component: Business
        }, {
            path: '/bloc',
            name: 'Bloc',
            component: Bloc
        }, {
            path: '/poly',
            name: 'Poly',
            component: Poly
        }, {
            path: '/sa',
            name: 'SA',
            component: SA
        }, ],
        redirect: '/business'
    },
    {
        path: '/newsDetail',
        name: 'NewsDetail',
        component: NewsDetail
    },
    {
        path: '/goodsList',
        name: 'GoodsList',
        component: GoodsList
    },
    {
        path: '/goodsDetail',
        name: 'GoodsDetail',
        component: GoodsDetail
    },
    // {
    //   path: '/about',
    //   name: 'About',
    //   // route level code-splitting
    //   // this generates a separate chunk (about.[hash].js) for this route
    //   // which is lazy-loaded when the route is visited.
    //   component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
    // }
]

const router = new VueRouter({
    routes
})

export default router